<?php

declare(strict_types=1);

use App\Model\AdminUser;
use Hyperf\Database\Seeders\Seeder;
use Hyperf\DbConnection\Db;
use Hyperf\Utils\Str;

class InsertSuperAdminUser extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $id = AdminUser::SUPER_ADMIN_ID;
        $name = 'Admin';
        $password_salt = Str::random(8);
        $password = sha1($password_salt . 'abc123');
        Db::table('admin_user')->insert(compact('id', 'name', 'password_salt', 'password'));
    }

}
